 <?php
echo $html->css ( 'tab' );
echo $html->css ( 'jquery-validate/css/screen' );
?>
<script type="text/javascript">
	function getDelStr() {
		var delArr = $("#f2 :checkbox:checked");
		if(delArr.length==0)
		{
			alert("请选择你要删除的项!");
			return;
		}
		if(!confirm("确定删除?"))
		{
			return;
		}
		var str = "";
		for(var i=0;i<delArr.length;i++) {
			var del = delArr[i].value;
			str += del;
			str += "/";
		}
		//window.alert(str);
		$("#delStr").val(str);
		//window.alert($("#delStr").val());
		$("#f2").submit();
	}
</script>
<script type="text/javascript">
	function mycheck() {
		$("#f2").submit();	
	}
	$(function()
			{
				$("#deletefile").click(function(){
					file = $("#ff");   
					file.after(file.clone());   
					file.remove(); 
				});
				$("#addfile").click(function(){
					$("#f3").validate({
						rules: {
						Specification: {
						required: true
						}
						},
						messages: {
							Specification: {
							required: "请选择上传附件"
							}
						},
						//设置验证触发事件 
						focusInvalid: false, 
						onkeyup: false, 
						//设置错误信息提示DOM  
						errorPlacement: function(error, element) { 
						error.appendTo( element.parent()); 
						}
					});
					$("#f3").submit();
				});
			});
</script>
<script type="text/javascript">
//必填项检测
$(document).ready(function(){

	 
		 $.validator.setDefaults({ 
			 submitHandler: function(form) {
			  form.submit();    
			}       
		});
		// validate signup form on keyup and submit

	});		
</script>
<!-- 当前位置-->
<div id="tabmenubar">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td class="tabmenubartitle1"><?php echo  __('YourPosition');//您现在的位置：?></td>
		<td class="tabmenubartitle2"><?php echo __('Customer Managements');//一级目录
										   echo '>';echo __('Customer Managements');//二级目录
										   echo '>';echo __('contractmanagementlist');//二级目录
										   echo '>';?>
									<?php echo $html->tag('span', __('合同信息',true));//当前操作地用span加粗?> 						  
		</td>
	</tr>
</table>
</div>
<table>
	<tr>
		<td width="50"></td>
		<td width="70"><a href="<?php echo ROOT_WEB_PATH; ?>/companymanages/initDetail/<?php echo $companyid?>">基本信息</a></td>
		<td width="70"><a href="<?php echo ROOT_WEB_PATH; ?>/companymanages/linkmanlist/<?php echo $companyid?>">联系人</a></td>
		<td width="70"><a href="<?php echo ROOT_WEB_PATH; ?>/companymanages/projectlist/<?php echo $companyid?>">项目列表</a></td>
		<td width="70"><a href="<?php echo ROOT_WEB_PATH; ?>/companymanages/initDetailRemark/<?php echo $companyid?>">备注信息</a></td>
		<td width="70"><a href="<?php echo ROOT_WEB_PATH; ?>/companymanages/contactallinfo/<?php echo $companyid?>">联系日志</a></td>
		<td width="70"><a href="<?php echo ROOT_WEB_PATH; ?>/companymanages/positionallinfo/<?php echo $companyid?>">职位列表</a></td>
		<td width="70"><a href="<?php echo ROOT_WEB_PATH; ?>/companymanages/contractmanagementlist/<?php echo $companyid?>">合同管理</a></td>
		<td width="70"><a href="<?php echo ROOT_WEB_PATH; ?>/companymanages/feemanageinit/<?php echo $companyid?>">费用统计</a></td>
		<td width="70"><a href="<?php echo ROOT_WEB_PATH; ?>/companymanages/staffallinfo/<?php echo $companyid?>">企业员工</a></td>
		<td width="70"><a href="<?php echo ROOT_WEB_PATH; ?>/companymanages/resumeReportAllinfo/<?php echo $companyid?>">简历报告</a></td>
		<td width="70"><a href="<?php echo ROOT_WEB_PATH; ?>/companymanages/appendixUpload/<?php echo $companyid?>">附件列表</a></td>
		<td width="70"><a href="<?php echo ROOT_WEB_PATH; ?>/companymanages/sameCompany/<?php echo $companyid?>">同行公司</a></td>
	</tr>
</table>

<div class="tabflex">
<fieldset><legend><?php echo __('合同信息')?></legend>



<table width="100%" cellspacing="0" cellpadding="0" border="0"
	style="text-align: left">
	<tr>
		<td width="50"></td>
		<td width="100">公司名称:</td>
		<td>
		<?php 
			echo $datas['Companymanage']['name'];	
		?>
		</td>
		<td width="50"></td>
		<td width="100">合同名称:</td>
		<td>
		<?php 
			echo $data['Contractmanagement']['name'];	
		?>
		</td>
	</tr>
	<tr>
		<td width="50"></td>
		<td width="100">签约人:</td>
		<td>
		<?php 
			echo $data['Contractmanagement']['signatory'];	
		?>
		</td>
		
		<td width="50"></td>
		<td width="100">签约时间:</td>
		<td>
		<?php 
			echo $data['Contractmanagement']['datesigned'];
		?>
		</td>
	</tr>
	<tr>
		
		<td width="50"></td>
		<td width="100">合同金额:</td>
		<td>
		<?php 
			echo $data['Contractmanagement']['amount'];
		?>
		</td>
		
		<td width="50"></td>
		<td width="100">付款方式:</td>
		<td>
		<?php 
			echo $data['Contractmanagement']['paymentmethod'];	
		?>
		</td>
	</tr>
	<tr>
		<td width="50"></td>
		<td width="100">开始时间:</td>
		<td>
		<?php 
			echo $data['Contractmanagement']['startTime'];
		?>
		</td>
		<td width="50"></td>
		<td width="100">结束时间:</td>
		<td>
		<?php 
			echo $data['Contractmanagement']['endTime'];
		?>
		</td>	
	</tr>
	<tr>
		<td width="50"></td>
		<td width="100" style="vertical-align:top;">基本信息:</td>
		<td  colspan="4">
		<?php 
			echo $data['Contractmanagement']['basicmessage'];
		?>
		</td>
	</tr>
	<tr>
		<td width="50"></td>
		<td width="100" style="vertical-align:top;">备注信息:</td>
		<td  colspan="4">
		<?php 
			echo $data['Contractmanagement']['memo'];
		?>
		</td>
	</tr>
</table>
</fieldset>


<?php echo $form->create('Companymanage',array('action'=>'delattachments','type'=> 'post','id'=>'f2'));?>
<?php echo $form->hidden('delStr',array('name'=>'id','id'=>'delStr'));?>
<?php echo $form->hidden('contractmanagementid',array('name'=>'contractmanagementid','id'=>'contractmanagementid','default'=>$data['Contractmanagement']['id']));?>
<div class="actions"  id="notices-actions">
	<ul>
		<li style="width:100px">
			<a onclick='getDelStr()'  class="btn4"><?php //echo $html->image('delete.gif', array('alt' =>  __('Delete', true),'border'=>'0','title'=> '删除','onclick'=>'getDelStr()'));?>删除附件</a>
		</li>
	</ul>
</div>
<div id="nav1" style="width:97%">
<table width="100%" cellpadding="0" cellspacing="0" class="tab1">
	<tr>
		<th width="70px"><?php echo __('Selected');?></th>
		<th ><?php echo __('附件名称');?></th>
		<th ><?php echo __('更新时间');?></th>
	</tr>
	<!-- Here's where we loop through our $Notes array, printing out post info --> 
	
	<?php 
	foreach ($attachments as $datas): 
	?>
		<tr class=normal onmouseover='this.className= "over " '
			onmouseup='this.className= "over " '
			onmouseout='this.className= "normal " '>
			<td>
<!-- 批量删除选择 -->				
			<?php echo $form->checkbox($datas['Attachment']['id'], array('value' => $datas['Attachment']['id']));?>
			</td>
			<td>
			<?php 	if($datas['Attachment']['fileName']!=null)
					{	
						$dir="files-contractmanagement";
						echo $html->link($datas['Attachment']['fileName'],
							'/recruitpositions/down/'.$dir.'/'.$datas['Attachment']['filePath'],
							array('class'=>'view'));
					}
			?> 
			
			</td>
			<td><?php echo $datas['Attachment']['modified']; ?></td>
		</tr> 
	<?php endforeach; ?>  
</table>
<?php echo $form->end();?>
</div>
<!-- 项目状态列表 -->

<?php echo $form->create('Companymanage',array('action'=>'addachments','type'=> 'post','enctype'=>'multipart/form-data','id'=>'f3'));?>
<?php echo $form->hidden('contractmanagementid',array('name'=>'contractmanagementid','id'=>'contractmanagementid','default'=>$data['Contractmanagement']['id']));?>
<table width="100%">
<tr>
	<td>
	<?php 	
	echo $form->file('Specification',array('label'=>false,'class' => 'TextBoxL','size'=>50,'name'=>'Specification','id'=>'ff'));
	?> 
	</td>
	<td width="100px">
		<?php echo $form->button('增加附件',array('class'=>'btn4','id'=>'addfile'));?>

	</td>
	<td width="100px">
		<?php echo $form->button('取消附件',array('class'=>'btn4','id'=>'deletefile'));?>
	</td>
</tr>
</table>
<?php echo $form->end();?>

